import $http from './api';

export const login = (data) => $http('post', 'admin/login', data);
export const logout = () => $http('get', 'admin/logout');
export const queryAdminArticleList = (data) => $http('post', 'admin/queryAdminArticleList', data);
export const createArticle = (data) => $http('post', 'admin/createArticle', data);
export const updateArticleIsShow = (data) => $http('post', 'admin/updateArticleIsShow', data);
export const deleteArticle = (data) => $http('post', 'admin/deleteArticle', data);
export const queryAdminArticleDetail = (data) => $http('get', 'admin/queryAdminArticleDetail', data);
export const queryAdminClassifyList = () => $http('get', 'admin/queryAdminClassifyList');
export const updateArticleDetail = (data) => $http('post', 'admin/updateArticleDetail', data);
export const removeFile = (url) => $http('post', 'alioss/removeFile', {url});
export const upload = (data) => $http('post', 'alioss/upload', data, 'formData');
export const queryAdminSlideList = (data) => $http('post', 'admin/queryAdminSlideList', data);
export const addAndUpdateSlide = (data) => $http('post', 'admin/addAndUpdateSlide', data);
export const deleteSlide = (id) => $http('post', 'admin/deleteSlide', {id: id});
export const updateSlideIsShow = (data) => $http('post', 'admin/updateSlideIsShow', data);
export const getCommentList = (blogId) => $http('get', 'getCommentList' + `/${blogId}`);
export const queryTags = () => $http('get', 'queryTags');
export const addAndUpdateTag = (data) => $http('post', 'admin/addAndUpdateTag', data);
